import React from 'react';
import Person from './Person/Person'

const Persons=(props) => {
  return props.persons.map((person,index) => {
    return <Person
      myclick={()=>props.clicked(index)}
      name={person.name}
      conunt={person.count}
      key={person.id}
      changed={(event)=>props.changed(event,person.id)}
    />
  })
};

export default Persons;
